package com.mmz.springmvc.form;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

public class UserAction implements Controller{
	@Override
	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
	
		ModelAndView modelAndView = new ModelAndView();
		
		String username = request.getParameter("username");
		modelAndView.addObject("msg",username);
		modelAndView.setViewName("success");
		return modelAndView;
	}

}
